  <?php if(!empty($id)) { ?>
 <form action="<?= $admin_base_url; ?>course/edit/<?=$id;?>/<?php echo $cur_page;?>" method="post" id="course_form">
 <?php } else { ?>
 <form action="<?= $admin_base_url; ?>course/add/<?= $cur_page;?>" method="post" id="course_form">
 <?php } ?>
 
<table  id="tblform">
<tbody>
	<tr>
		<td>Course Name</td>
		<td><input class="input" type="text" name="name" value="<?php echo $course['name'];?>" /></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td>     
			<div class="buttons">
			    <button type="submit" name="save" class="positive" value="save" >
			        <img src="<?php echo $admin_image_path?>icons/apply.png" alt=""/>
			          <?php if(!empty($id)) { ?>
 							Update Course
 							<input type="hidden" name="id" value="<?php echo $id;?>" />
                       
 							<input  type="hidden" name="rurl" value="<?php echo $rurl;?>" />
 					  <?php } else { ?>
 					  	Add Course
 					  	<?php } ?>

 			    </button>
			   <a href="<?= $admin_base_url; ?>course/cancel?rurl=<?php echo $rurl;?>" class="negative">
			        <img src="<?php echo $admin_image_path?>icons/cross.png" alt=""/>
			        Cancel
			   </a>
			</div>
		</td>
	</tr>
</tbody>
</table>
 </form>
 <script>
 $(document).ready(function() {
     $("#course_form").RSV({
       onCompleteHandler: frmSubmit,
       errorFieldClass: "errorDesc",
       displayType: "display-html",
       errorHTMLItemBullet: "&#8212; ",
             rules: [
                     "required,name,Please enter name."
             ]
     });
  // a custom onComplete handler to prevent form submits for the demo
     function frmSubmit()
     {
       return true;
     }

        
});
 </script>